.386
.model flat, stdcall
option casemap :none
include \masm32\include\windows.inc
include \masm32\include\kernel32.inc
include \masm32\include\user32.inc
includelib \masm32\lib\kernel32.lib
includelib \masm32\lib\user32.lib
.stack 200
.data
__error_resta db "RESULTADO NEGATIVO EN RESTA", 0
__error_overflow db "OVERFLOW EN PRODUCTO", 0
__error_division db "ERROR EN DIVISION", 0
__error db "ERROR", 0
_0ul dd 0
_ELSEEXTERNO3ELSEINTERNO db "ELSE EXTERNO  3 ELSE INTERNO", 0
_IFEXTERNO0IFINTERNO db "IF EXTERNO  0 IF INTERNO", 0
_1ul dd 1
_ELSEEXTERNO2IFINTERNO db "ELSE EXTERNO  2 IF INTERNO", 0
_IFEXTERNO1ELSEINTERNO db "IF EXTERNO  1 ELSE INTERNO", 0
_3ul dd 3
_a dd ?
_4ul dd 4
.code
start:
@Label1:
MOV ebx, _0ul
MOV _a, ebx
@Label3:
MOV ebx, _a
CMP ebx, _4ul
JGE @Label44
MOV ebx, _a
CMP ebx, _1ul
JG @Label26
MOV ebx, _a
CMP ebx, _0ul
JNE @Label22
invoke MessageBox, NULL, addr _IFEXTERNO0IFINTERNO, addr _IFEXTERNO0IFINTERNO, MB_OK
JMP @Label24
@Label22:
invoke MessageBox, NULL, addr _IFEXTERNO1ELSEINTERNO, addr _IFEXTERNO1ELSEINTERNO, MB_OK
@Label24:
JMP @Label37
@Label26:
MOV ebx, _a
CMP ebx, _3ul
JGE @Label35
invoke MessageBox, NULL, addr _ELSEEXTERNO2IFINTERNO, addr _ELSEEXTERNO2IFINTERNO, MB_OK
JMP @Label37
@Label35:
invoke MessageBox, NULL, addr _ELSEEXTERNO3ELSEINTERNO, addr _ELSEEXTERNO3ELSEINTERNO, MB_OK
@Label37:
MOV ebx, _a
ADD ebx, _1ul
@Label40:
MOV _a, ebx
JMP @Label3
@Label44:
jmp fin
overflow:
invoke MessageBox, NULL, addr __error_overflow, addr __error, MB_OK
invoke ExitProcess, 0
res_negativo:
invoke MessageBox, NULL, addr __error_resta, addr __error, MB_OK
invoke ExitProcess, 0
division:
invoke MessageBox, NULL, addr __error_division, addr __error, MB_OK
invoke ExitProcess, 0
fin:
invoke ExitProcess, 0
end start